
$(function() {

var demoMenu = new demo();
window.demoMenu = demoMenu;

var elems = $('textarea').growfield('disable');

demoMenu.add('growfield', {
    name: 'Growfield',
    description: '',
    renderTo: '#growfield',
    docURL: 'growfield.xml',
    tests: [{
            //////// ENABLE / DISABLE
            name: 'Enable/Disable',
            elems: elems,
            presets: [{
                name: 'Enabled'
                }, {
                name: 'Disabled'
            }],
            handler: function(key, elems) {
                elems.growfield(key==0?true:false);
            }
        }, {
            name: 'Auto mode',
            elems: elems,
            docref: 'auto',
            before: function(elems, mode) { elems.growfield(false); },
            after: function(elems) {
                elems.filter(function(){
                    return $(this).parents('.examples').eq(0).is(':visible');
                }).growfield(true);
            },
            presets: [{
                    name: 'Enabled',
                    options: { auto: true, min: false }
                }, {
                    name: 'Disabled (ctrl+up/down)',
                    options: { auto: false, min: false }
            }]
        }, {
            name: 'Animation',
            elems: elems,
            docref: 'animate',
            presets: [{
                    name: 'Default (200ms)',
                    options: { animate: 200 }
                }, {
                    name: 'Disabled',
                    options: { animate: false }
            }]
        }, {
            name: 'Restore',
            elems: elems,
            docref: 'restore',
            presets: [{
                    name: 'Disabled',
                    options: { restore: false }
                }, {
                    name: 'Enabled',
                    options: { restore: true }
            }]
        }, {
            name: 'Min/max',
            elems: elems,
            docref: 'min, max',
            presets: [{
                    name: 'Disabled',
                    options: { min: false, max: false }
                }, {
                    name: 'Min: 50, max: 200',
                    options: { min: 50, max: 200 }
            }]
    }]
});

demoMenu.render();
});
